package pdd.exceptions;

/**
 * Created by admin on 2018/6/11.
 * 拼多多异常码及异常说明
 * @see <a href="http://open.pinduoduo.com/#/apidocument/port?id=26">http://open.pinduoduo.com/#/apidocument/port?id=26</a>
 * @author admin
 */
public enum PddExceptionCodeEnum {

    /*************** 拼多多平台返回码 *********************/
//
//    PARAM_ERROR("10000","参数错误","参数值有误，按照文档要求填写请求参数"),
//    SYSTEM_ERROR("50000","系统内部错误","系统内部错误，请加群联系相关负责人"),
//    OAUTH_ERROR("20000","OAuth认证失败","错误的access_token"),
//    DDK_ERROR("20001","多多客业务错误","多多客相关问题，请联系多多客工作人员罗素，邮件地址：luosu@pinduoduo.com"),
//    NULL_CLIENTID_ERROR("20002","错误的client_id","请求中参数client_id不存在"),
//    SIGN_ERROR("20003","缺少签名sign字段","请求中缺少请求参数 sign"),
//    SIGN_CHECK_ERROR("20004","签名sign校验失败","请按照接入指南第三部分指导，生成签名"),
//    LOSE_TYPE_ERROR("20005","缺少参数type","请求中缺少请求参数 type"),
//    INCORRECT_TYPE_ERROR("20006","参数type值有误","参见文档，输入正确的 type"),
//    LOSE_MUST_PARAM_ERROR("20007","缺少必填请求参数","请查看接入指南第三部分和API文档，核对公共参数和业务必填参数是否正确"),
//    DATA_TYPE_ERROR("20008","请求参数 data_type 值有误","data_type值为XML或JSON，是大写"),
//    LOSE_SECRET_ERROR("20009","缺少生成签名的secret","参见文档，商家自主接入，在拼多多后台系统 mms 中填写secret"),
//    TIMESTAMP_ERROR("20017","时间戳格式有误","时间戳为格林威治时间到所填时间的秒数"),
//    GET_SHOP_NUM_ERROR("20010","获取店铺编号失败","可能是当前店铺已关店，如果不是请联系拼多多技 术支持"),
//    ALL_CALLING_FREQUENCY_ERROR("20021","超过调用频率限制","降低调用频率，具体参考API限流表"),
//    METHOD_ERROR("10002","请求方法错误，仅支持POST","请使用POST请求"),
//    NOT_EXIST_APP_ERROR("10010","应用不存在","您的应用不存在"),
//    REJECTION_APP_ERROR("10011","应用已被驳回","请前往拼多多开放平台查看应用驳回的原因，及时修改并重新提交应用，或者创建新的应用"),
//    CANCELD_AUTH_ERROR("10014","授权已被取消","商家和您的授权关系已经取消了"),
//    INCORRECT_CLIENTID_ERROR("10016","client_Id不正确","请核查您的client_Id是否正确"),
//    EXPIRED_TOKEN_ERROR("10035","access_token已过期","请刷新access_token或者重新授权获取access_token"),
//    UNKNOWN_ERROR("50001","未知错误","未知错误，请加群联系相关负责人"),
//    UNAUTHED_PERMISSION_ERROR("20031","用户没有授权访问此接口","您创建的应用中不包含此接口，请查看API文档，了解相关权限包"),
//    SECOND_CALLING_FREQUENCY_ERROR("70031","调用过于频繁，请调整调用频率","调用过于频繁，请调整调用频率"),
//    INTERFACE_MAINTENANCE_ERROR("70033","当前接口因系统维护，暂时下线，请稍后再试！","当前接口因系统维护，暂时下线，请稍后再试！"),
//    SECOND_CALLING_FREQUENCY_ERROR2("70032","调用过于频繁，请调整调用频率","调用过于频繁，请调整调用频率"),
//    EXPIRED_TOKEN_ERROR2("10019","access_token已过期","刷新access_token或者重新授权再次获取access_token"),


    /****************** 星座网返回码 100000 开始*************************/
    UNSUPPORTED_ENCODING_ERROR("xz100000","请求参数编码异常","请检验请求参数"),
    NOSUCH_ALGORITHM_ERROR("xz100001","参数加密异常，不支持的加密方式","请检查加密方式"),
    RESPONSE_NULL_ERROR("xz100002","请求结果为空","请查看请求"),
    RESPONSE_TO_JSON_ERROR("xz100003","请求结果转换Json错误","请查看请求结果"),


    XZ_SYSTEM_ERROR("500000","未知错误","未知错误，请DEBUG"),
    CODE_UN_FINISHED_ERROR("800000","代码还没写","请补全代码"),


    ;

    PddExceptionCodeEnum(String errCode, String errMsg, String solution) {
        this.errCode = errCode;
        this.errMsg = errMsg;
        this.solution = solution;
    }

    /**
     * 异常码
     */
    private String errCode;
    /**
     * 异常说明
     */
    private String errMsg;
    /**
     * 解决办法
     */
    private String solution;

    public String getErrCode() {
        return errCode;
    }

    public String getErrMsg() {
        return errMsg;
    }

    public String getSolution() {
        return solution;
    }
}
